<div class="window">
    <div class="window-status" ng-if="isLoading">
        <div class="progress-bar"></div>
    </div>
    <header class="window-head">
        <img class="__logo" ng-src="{{uiCustomization.contrast_logo || '/images/contrast-logo.png'}}" />
        <span class="window-t">{{ 'platform.blades.resetpassword.title' | translate }}</span>
    </header>
    <div class="window-cnt">
        <form class="form" novalidate ng-submit="ok()" name="detailForm">
            <div class="form-group" ng-if="!succeeded">
                <label class="form-label" ng-class="">{{ 'platform.blades.account-resetPassword.labels.new-password' | translate }}</label>
                <div class="form-input">
                    <input name="newPassword" ng-model="viewModel.newPassword" required placeholder="{{ 'platform.blades.account-resetPassword.placeholders.new-password' | translate }}" type="password" ng-disabled="!isValidToken">
                </div>
            </div>
            <div class="form-group" ng-if="!succeeded">
                <label class="form-label">{{ 'platform.blades.account-resetPassword.labels.repeat-password' | translate }}</label>
                <div class="form-input">
                    <input name="newPassword2" ng-model="viewModel.newPassword2" ng-class="{'error': viewModel.newPassword != viewModel.newPassword2}" required placeholder="{{ 'platform.blades.account-resetPassword.placeholders.repeat-password' | translate }}" type="password" ui-validate=" '$value==viewModel.newPassword' " ui-validate-watch="'viewModel.newPassword'" ng-disabled="!isValidToken">
                </div>
                <div class="form-error" ng-if="!detailForm.newPassword2.$pristine && viewModel.newPassword != viewModel.newPassword2">
                    <span>{{ 'platform.blades.account-resetPassword.validations.repeat-password' | translate }}</span>
                </div>
            </div>

            <div class="form-group" ng-if="succeeded">
                <div class="form-green" ng-bind="'platform.blades.resetpassword.labels.success' | translate"></div>
            </div>
            <div class="form-group" ng-if="errors || !isValidToken">
                <div class="form-error" ng-show="!isValidToken" ng-bind="'platform.blades.account-resetPassword.validations.invalid-token' | translate"></div>
                <div class="form-error" ng-repeat="error in errors" ng-bind="error"></div>
            </div>
            <div class="form-group __right">
                <button class="btn" type="submit" ng-disabled="detailForm.$invalid || isLoading || !isValidToken" ng-if="!succeeded">
                    <span>{{ 'platform.blades.resetpassword.labels.submit' | translate }}</span>
                </button>
                <button ui-sref="loginDialog" class="btn" ng-if="succeeded">
                    <span>{{ 'platform.blades.resetpassword.labels.log-in' | translate }}</span>
                </button>
            </div>
        </form>
    </div>
</div>
